using System;
using System.Collections.Generic;
using System.Text;
using Shc.Sql;
using Shc.Json;
namespace CLZ.Data
{
	public static class TableViewMemberAccount
	{
		public const string Table = "View_MemberAccount";
		public const string LoginName = "LoginName";
		public const string MemberAccountID = "MemberAccountID";
		public const string MembersID = "MembersID";
		public const string AccountBalance = "AccountBalance";
		public const string DeltaTotal = "DeltaTotal";
		public const string TotalUse = "TotalUse";
		public const string LastModified = "LastModified";
		public const string CreateDate = "CreateDate";
	}
	
	[Serializable]
	public class BaseViewMemberAccount
		: IDbSessionEntity, IJsonClass
	{
		string m_LoginName;
		/// <summary>
        /// 
        /// </summary>
        public string LoginName
        {
            get { return m_LoginName; }
            set { m_LoginName = value; }
        }
		
		int m_MemberAccountID;
		/// <summary>
        /// 
        /// </summary>
        public int MemberAccountID
        {
            get { return m_MemberAccountID; }
            set { m_MemberAccountID = value; }
        }
		
		int? m_MembersID;
		/// <summary>
        /// 
        /// </summary>
        public int? MembersID
        {
            get { return m_MembersID; }
            set { m_MembersID = value; }
        }
		
		double m_AccountBalance;
		/// <summary>
        /// 
        /// </summary>
        public double AccountBalance
        {
            get { return m_AccountBalance; }
            set { m_AccountBalance = value; }
        }
		
		double m_DeltaTotal;
		/// <summary>
        /// 
        /// </summary>
        public double DeltaTotal
        {
            get { return m_DeltaTotal; }
            set { m_DeltaTotal = value; }
        }
		
		double m_TotalUse;
		/// <summary>
        /// 
        /// </summary>
        public double TotalUse
        {
            get { return m_TotalUse; }
            set { m_TotalUse = value; }
        }
		
		DateTime m_LastModified;
		/// <summary>
        /// 
        /// </summary>
        public DateTime LastModified
        {
            get { return m_LastModified; }
            set { m_LastModified = value; }
        }
		
		DateTime m_CreateDate;
		/// <summary>
        /// 
        /// </summary>
        public DateTime CreateDate
        {
            get { return m_CreateDate; }
            set { m_CreateDate = value; }
        }
		
		
		#region IDbSessionEntity Members
		public void ReadDBData(RowDataReader reader)
        {
            m_LoginName = reader[TableViewMemberAccount.LoginName];
            m_MemberAccountID = reader[TableViewMemberAccount.MemberAccountID];
            m_MembersID = reader[TableViewMemberAccount.MembersID];
            m_AccountBalance = reader[TableViewMemberAccount.AccountBalance];
            m_DeltaTotal = reader[TableViewMemberAccount.DeltaTotal];
            m_TotalUse = reader[TableViewMemberAccount.TotalUse];
            m_LastModified = reader[TableViewMemberAccount.LastModified];
            m_CreateDate = reader[TableViewMemberAccount.CreateDate];
        }
		
		public void WriteDBData(RowDataWriter writer)
        {
        }

        public void SetIdentityAfterInsert(DBObject idd)
        {
        }
		
		public string TableName
        {
            get { return TableViewMemberAccount.Table; }
        }
		#endregion
		
		
		#region IJsonClass Members

        public void JsonDeSerializeObj(JsonHashTable hashToRead)
        {
             m_LoginName = hashToRead["LoginName"];
			 
             m_MemberAccountID = hashToRead["MemberAccountID"];
			 
             m_MembersID = hashToRead["MembersID"];
			 
             m_AccountBalance = hashToRead["AccountBalance"];
			 
             m_DeltaTotal = hashToRead["DeltaTotal"];
			 
             m_TotalUse = hashToRead["TotalUse"];
			 
             m_LastModified = hashToRead["LastModified"];
			 
             m_CreateDate = hashToRead["CreateDate"];
			 
        }

        public void JsonSerializeObj(JsonHashTable hashToFill)
        {
            hashToFill["LoginName"] = LoginName;
			
            hashToFill["MemberAccountID"] = MemberAccountID;
			
            hashToFill["MembersID"] = MembersID;
			
            hashToFill["AccountBalance"] = AccountBalance;
			
            hashToFill["DeltaTotal"] = DeltaTotal;
			
            hashToFill["TotalUse"] = TotalUse;
			
            hashToFill["LastModified"] = LastModified;
			
            hashToFill["CreateDate"] = CreateDate;
			
        }

        #endregion
		
	}
}
